package com.xindacloud.sms.console.system.exception;


public class UnknowException extends RuntimeException {

    Object data;

    public UnknowException(String msg, Object data) {
        super(msg);
        this.data = data;
    }

    public static UnknowException.UnknowExceptionBuilder builder() {
        return new UnknowException.UnknowExceptionBuilder();
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "UnknowException{" +
                "data=" + data + "," +
                "message=" + getMessage() +
                '}';
    }

    public static class UnknowExceptionBuilder {

        private Object data;
        private String msg;

        UnknowExceptionBuilder() {}

        public UnknowException.UnknowExceptionBuilder data(Object data) {
            this.data = data;
            return this;
        }

        public UnknowException.UnknowExceptionBuilder msg(String msg) {
            this.msg = msg;
            return this;
        }

        public UnknowException build() {
            return new UnknowException(this.msg, this.data);
        }

    }
}
